home *** CD-ROM | disk | FTP | other *** search
- Path: maine.maine.edu!io92118
- Organization: University of Maine System
- Date: Sat, 30 Mar 1996 20:23:03 EST
- From: <IO92118@MAINE.MAINE.EDU>
- Message-ID: <96090.202303IO92118@MAINE.MAINE.EDU>
- Newsgroups: comp.lang.c++
- Subject: Help for integer multiplication???
-
- Hi:
-
- I want to write a program to do integer multiplication.
-
- 1101 1110 1010 0001
- 1010 1101 0010 1010
- -------------------
-
- for normal method, it's time complexity is n square.
-
- if I devide it into two parts.
- 2**(n/2)*1101 1110 + 1010 0001
- 2**(n/2)*1010 1101 + 0010 1010 this is 3**(log(n)) much faster.
- -------------------------------
- ** means to the power. exactly 2**(n/2) mean shift.
-
- If I want to a program, how to represent 1101 1110 1010 0001 ???
- Can I just decimal number or not, or something else???
-
- Thank you very much!!!
-